<%@ page import="com.apexedu.portal.constant.Constants" %>
<%@ page import="com.apexedu.portal.entity.TFrontdeskNews" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    request.setAttribute("basePath", request.getContextPath());
    TFrontdeskNews tfrontdesknews = (TFrontdeskNews)request.getAttribute("tfrontdesknews");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><%=Constants.ProjectInfo.PROJECT_NAME%></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="${basePath}/resources/css/mh.shmy.css" rel="stylesheet">
    <script type="text/javascript" src="${basePath}/resources/ui/js/jquery-1.10.2.min.js"></script>
    <script src="${basePath}/resources/js/mh.shmy.index.js" type="text/javascript"></script>
</head>
<style>
    img{ border:none}
    ul{list-style:none;}
    li{letter-spacing:1px; list-style:none}
    /*主体*/
    .acon{width:80%; border-radius:5px; margin:8px auto; border:1px solid #a6cee0;}
    /*主体*/
</style>
<script>
    var imgUrl = 'http://oa.sada.sh.edu.cn/';
    var intss;
    var i=0;
    $(function () {
        intss = setInterval("countDown()", 500);

    });
    function countDown() {
        if ($("img[src*='/UserFiles']:not([src*='http://web.sada.sh.edu.cn'])").length > 0) {
            $("img[src*='/UserFiles']:not([src*='http://web.sada.sh.edu.cn'])").attr("src", function () {
                var src = $(this).attr("src");
                return imgUrl + src.substring(src.indexOf("/UserFiles"));
            });
        } else {
            window.clearInterval(intss);
        }
    }

    // 第一次图片加载不出来，自动刷新一次页面
    function reloadImg(imgID, recordID) {
        var url="http://oa.sada.sh.edu.cn/FormOperate?Table=tBlog&ID="+recordID+"&Column=Picture1&operate=Download&Type=View";
        if (i < 5) {
          $("#"+imgID).src
          $("#"+imgID).attr("src",url);
        }
    }
</script>
<body>

<input type="hidden" id="choosed" value="3"/>
<div id="main">
    <jsp:include page="left.jsp"/>
    <div id="right">
        <jsp:include page="head.jsp"/>
        <!--主体-->
        <div style="width: 100%;background-color:#FFFFFF;height: 100% ">
            <div style=" margin:auto; width:90%;">
                <div style="border-bottom:2px solid #666666;height:70px; line-height:70px; padding-top:8px; padding-left:10px; font-size:14px;min-width:900px;">
                    <div id="lm_mc" style="text-align: left;width:650px; float:left">首页&gt; <a href="javascript:;" onclick="window.location.href='${basePath}/s/uc/shmy/fdn/<%=tfrontdesknews.getWeiz()%>'" ><%=tfrontdesknews.getLmmc()%></a></div>
                </div>
                <div style="position: absolute;top:180px;width: 95%;left:0px;">
                    <div style="width: 80%; margin:auto; padding-top:40px;border-bottom:dashed 1px #d6dfe4;min-width:700px;">
                        <ul style="list-style:none; padding-left:10px; text-align:left;position: relative;">
                            <li style="position: relative;top:30px; border:none; font-size:36px; text-align:center; font-weight:bold; height:50px; line-height:50px;letter-spacing:3px;">${twz.title }</li>
                            <li style="position: relative;top:30px;height:24px; line-height:24px; text-align:left;padding-top:60px; ">
                             <span>阅读：<a style="color: blue">${twz.djs }</a> &nbsp;
                             &nbsp;&nbsp;&nbsp;发布时间：<fmt:formatDate value="${twz.cjrq}" pattern="yyyy.MM.dd"/>
                             </span>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                              <span >发布人：&nbsp;<a style="color: blue">${twz.cjr}</a>
                             &nbsp;&nbsp;&nbsp;发布单位：<a style="color: blue">${twz.departname}</a>
                             </span>
                            </li>
                        </ul>
                    </div>
                    <div style="position: relative;top:30px;width: 80%; margin:auto; padding: 15px;font-size: 16px;line-height:25px;text-indent: 1.8em;text-align:left;min-width:700px;">
                        ${twz.nr }
                        <br/>
                        <div style="font-size: 20px">
                            <c:if test="${twz.picture1!=null}">
                                <img width="700" id="Picture1" src ='http://oa.sada.sh.edu.cn/FormOperate?Table=tBlog&ID=${twz.wid}&Column=Picture1&operate=Download&Type=View' onerror="reloadImg('Picture1', '${twz.wid}');" border="0" />

                            </c:if>
                        </div>

                        <div style="font-size: 20px">
                            <c:if test="${twz.picture2!=null}">
                                <img width="700" id="Picture2" src ='http://oa.sada.sh.edu.cn/FormOperate?Table=tBlog&ID=${twz.wid}&Column=Picture2&operate=Download&Type=View' onerror="reloadImg('Picture2', '${twz.wid}');" border="0"/>

                            </c:if>
                        </div>
                        <div style="font-size: 20px;text-align: left;padding: 15px;">
                            <c:if test="${twz.attachment!=null}">
                                <img src="${basePath}/resources/images/shmy/attach.gif">
                                <a target="_blank" href="http://oa.sada.sh.edu.cn/UIProcessor?Table=tBlog&ID=${twz.wid}&Column=Attachment&operate=Download&Type=View">${twz.title }.附件</a>
                                <a href="http://oa.sada.sh.edu.cn/UIProcessor?Table=tBlog&ID=${twz.wid}&Column=Attachment&operate=Download&Type=Attachment">
                                    <img src="${basePath}/resources/images/shmy/col-move-top.gif">
                                    下载
                                </a>
                            </c:if>
                        </div>
                        <div style="font-size: 20px;text-align: left;padding: 15px 0 15px 0;">

                            <c:if test="${twzAttachmentList!=null&&fn:length(twzAttachmentList)>0}">
                                <c:forEach var="entity" items="${twzAttachmentList}" varStatus="status">
                                    <div style="margin-left: 5px;line-height: 50px;height: 50px;">
                                    <img src="${basePath}/resources/images/shmy/attach.gif">
                                    <a target="_blank" href="http://oa.sada.sh.edu.cn/UIProcessor?Table=tBlog&ID=${entity.id}&Column=Document&operate=HypotDownload&Type=Attachment&HypotSrcColumn=More">${entity.document}</a>
                                    <a href="http://oa.sada.sh.edu.cn/UIProcessor?Table=tBlog&ID=${entity.id}&Column=Document&operate=HypotDownload&Type=Attachment&HypotSrcColumn=More">
                                        <img src="${basePath}/resources/images/shmy/col-move-top.gif">
                                        下载
                                    </a>
                                    </div>
                                </c:forEach>
                            </c:if>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>